package com.lili.collection.mq.config;

import com.lili.collection.core.config.OutputConfig;
import com.lili.collection.core.domain.CollectCommonConfig;
import com.lili.collection.core.plugins.OutputPlugin;
import com.lili.collection.core.support.ConfigFieldDef;
import com.lili.collection.mq.plugins.RocketmqOutputPlugin;
import lombok.Data;

/**
 *描述: rocketmq输出配置
 *@date: 2023/6/3  15:35
 *@author: lili
 */
@Data
public class RocketmqOutputConfig extends CollectCommonConfig implements OutputConfig {

    /**
     * 注册服务地址
     */
    @ConfigFieldDef(type = ConfigFieldDef.Type.STRING, required = true)
    private String namesrvAddr;

    /**
     * 生产者组
     */
    @ConfigFieldDef(type = ConfigFieldDef.Type.STRING, required = true)
    private String group;

    /**
     * 生产主题
     */
    @ConfigFieldDef(type = ConfigFieldDef.Type.STRING, required = true)
    private String topic;

    @Override
    public OutputPlugin getPlugin() {
        return new RocketmqOutputPlugin();
    }
}